//
//  StellCaiculatorCollectionViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/22.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "StellCaiculatorCollectionViewCell.h"

@interface StellCaiculatorCollectionViewCell ()
@property (nonatomic,strong)GLGWImageView * goodsImageView;
@property (nonatomic,strong)GLGWLabel * goodsNameLabel;
@end

@implementation StellCaiculatorCollectionViewCell{

    
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        GLGWView * bankgroundView = [[GLGWView alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(3), kHeightProportion_In_iPhoneTriploid(3), kWidthProportion_In_iPhoneTriploid(95), kHeightProportion_In_iPhoneTriploid(95)) inSuperView:self];
        bankgroundView.backgroundColor = [UIColor whiteColor];
        [bankgroundView setViewShadowWidth:6.0 theCornerRadius:3.0];
        //
        self.goodsImageView = [[GLGWImageView alloc] initWithImageName:@"pp" inSuperView:bankgroundView];
//        self.goodsImageView.backgroundColor = kRandomColor;
        [self.goodsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(bankgroundView);
            make.top.equalTo(bankgroundView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(15));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(40)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(40)));
        }];
        //
        self.goodsNameLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:kColor_Rule_Black inSuperView:bankgroundView];
        [self.goodsNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(bankgroundView);
            make.top.equalTo(self.goodsImageView.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(7));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(20)));
        }];
    }
    return self;
}

-(void)theStellName:(NSString *)stellNameStr theStellImage:(NSString *)stellImage{
    self.goodsImageView.imageName = stellImage;
    self.goodsNameLabel.text = stellNameStr;
}
@end
